home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.5 KB | 43 lines | [TEXT/GEOL] |
- Item 8103847 10-July-90 16:06PDT
-
- From: VERITY Verity, Bob Williams,PRT
-
- To: MACDTS Macintosh Developer Tech Supt
- MACAPP.TECH$ MacApp Technical
-
- Sub: MATextBox problem...
-
-
- Hi,
-
- I've found what might well be a bug in MATextBox as used by TStaticText, or at
- least in my understanding of it or my understanding of fonts. I've created a
- custom font which is identical to Chicago-12 except for some special characters
- that I added - the key point, as will become clear below, is that the widest of
- these special characters is 58 pixels, which is far wider than the rest of
- Chicago-12.
-
- When I try to display a right-justified string in this font in a TStaticText,
- MATextBox causes the destination rectangle of its private TE to be wider than
- the size of the TStaticText, which causes half the text to be imaged to the
- right of the TStaticText box. The following snippet from MATextBox illustrates
- the problem quite explicitly - it assumes that the widest character of any font
- is always smaller than any given string in that font, which obviously isn't
- true.
-
-
- { Enforce minimum width on destRect ala IM-I pp. 383. Although the text
- says that
- 20 is a good number, using the widMax ensures that it is correct for all
- font sizes. }
- WITH destRect DO
- right := left + Max(Max(right - left, widMax), 20);
-
-
- This seems completely wrong to me - can someone enlighten me?
-
- Anders Wallgren
- Verity, Inc.
- Applelink: VERITY
-
-